:root {
  --left-bg-color: rgba(87, 84, 236, 0.3);
  --right-bg-color: rgba(43, 43, 43, 0.8);
  /* 左边覆盖效果 */
  --left-btn-hover-color: rgba(87, 84, 236, 1);
  --right-btn-hover-color: rgba(28, 122, 20, 1);
  /* 覆盖宽度 */
  --hover-width: 75%;
  /* 没有覆盖宽度 */
  --other-width: 25%;
  /* 速度 */
  --speed: 1000ms;
}

* {
  box-sizing: border-box;
}

body {
  height: 100vh;
  overflow: hidden;
  margin: 0;
}

.container {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #333;
}

.split {
  position: absolute;
  width: 50%;
  height: 100%;
}

.split h1 {
  font-size: 4rem;
  color: #fff;
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  /* 字体不换行 */
  white-space: nowrap;
}

.btn {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  /* 字母转换成大写 */
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  border: 0.2rem solid #fff;
  font-size: 1rem;
  font-weight: bold;
  width: 15rem;
  padding: 1.5rem;
}

.split.left .btn:hover {
  background-color: var(--left-bg-color);
  border-color: var(--left-btn-hover-color);
}

.split.right .btn:hover {
  background-color: var(--right-bg-color);
  border-color: var(--right-btn-hover-color);
}

.split.left {
  left: 0;
  background: url('https://pic.wenwen.soso.com/pqpic/wenwenpic/0/20200316045238-1666934620_jpeg_480_800_91076/0') no-repeat;
  background-size: cover;
}

.split.left::before {
  /* 设置这个样式后就会在图片上放有一层蒙版 */
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: var(--left-bg-color);
}

.split.right {
  right: 0;
  background: url('http://5b0988e595225.cdn.sohucs.com/images/20171026/0fdd10af3f3846c7a7efd4a935378649.jpeg') no-repeat;
  background-size: cover;
}

.split.right::before {
  /* 设置这个样式后就会在图片上放有一层蒙版 */
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: var(--right-bg-color);
}

.split.left,
.split.right,
.split.left::before,
.split.right::before {
  transition: all var(--speed) ease-in-out;
}

.hover-left .left {
  width: var(--hover-width);
}

.hover-left .right {
  width: var(--other-width);
}

.hover-right .left {
  width: var(--other-width);
}

.hover-right .right {
  width: var(--hover-width);
}

@media(max-width:800px) {
  h1 {
    font-size: 2rem;
    top: 30%;
  }

  .btn {
    padding: 1.2rem;
    width: 12rem;
  }
}